package com.niit.serviceorder.service.impl;

import com.niit.servicecommon.entity.Order;
import com.niit.serviceorder.mapper.OrderMapper;
import com.niit.serviceorder.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    
    @Autowired
    private OrderMapper orderMapper;
    
    @Override
    public List<Order> getAllOrders() {
        return orderMapper.selectAllOrders();
    }
    
    @Override
    public Order getOrderById(Long id) {
        return orderMapper.selectOrderById(id);
    }
    
    @Override
    public void addOrder(Order order) {
        orderMapper.insertOrder(order);
    }
    
    @Override
    public void updateOrder(Order order) {
        orderMapper.updateOrder(order);
    }
    
    @Override
    public void deleteOrder(Long id) {
        orderMapper.deleteOrder(id);
    }
}